<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
	"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title>Sim Panel test</title>
	<script src="../src/sim.js" type="text/javascript" charset="utf-8"></script>
	<script src="../src/random.js" type="text/javascript" charset="utf-8"></script>
	<script src="../src/request.js" type="text/javascript" charset="utf-8"></script>
	<script src="../src/stats.js" type="text/javascript" charset="utf-8"></script>
	<script src="../src/queues.js" type="text/javascript" charset="utf-8"></script>
	
	<script src="lib/jquery-1.6.2.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="lib/jquery-ui-1.8.16.custom.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="lib/raphael-min.js" type="text/javascript" charset="utf-8"></script>
	<script src="lib/g.raphael-min.js" type="text/javascript" charset="utf-8"></script>
	<script src="lib/g.bar-min.js" type="text/javascript" charset="utf-8"></script>
	
	
	<script src="simpanel.js" type="text/javascript" charset="utf-8"></script>
	<script src="queue.js" type="text/javascript" charset="utf-8"></script>
	
	<link rel="stylesheet" href="panel.css" type="text/css" media="screen" title="no title" charset="utf-8">
	<link rel="stylesheet" href="css/jquery-ui-1.8.16.custom.css" type="text/css" media="screen" title="no title" charset="utf-8">
	
	<script type="text/javascript" charset="utf-8">

		$(function () {
			
			QueueApp.init();
			QueueApp.reset();
	
QueueApp.loadtext('[{"x":384,"y":73,"type":"monitor","name":"monitor_1","model":null},{"x":156,"y":92,"type":"source","name":"source_1","out":"monitor_1","model":{"lambda":0.25}}]');

//QueueApp.loadtext('[{"x":324,"y":158,"type":"splitter","name":"splitter_1","out":["queue_2","queue_1"],"model":{"prob":0.5}},{"x":315,"y":259,"type":"source","name":"source_5","out":"queue_1","model":{"lambda":0.5}},{"x":310,"y":68,"type":"source","name":"source_4","out":"queue_2","model":{"lambda":0.5}},{"x":162,"y":229,"type":"source","name":"source_3","out":"queue_4","model":{"lambda":0.5}},{"x":169,"y":125,"type":"source","name":"source_2","out":"queue_4","model":{"lambda":0.5}},{"x":5,"y":237,"type":"source","name":"source_1","out":"queue_3","model":{"lambda":0.5}},{"x":190,"y":165,"type":"queue","name":"queue_4","out":"splitter_1","model":{"nservers":1,"mu":1,"infinite":true,"maxqlen":0}},{"x":40,"y":165,"type":"queue","name":"queue_3","out":"queue_4","model":{"nservers":1,"mu":1,"infinite":true,"maxqlen":0}},{"x":362,"y":91,"type":"queue","name":"queue_2","model":{"nservers":1,"mu":1,"infinite":true,"maxqlen":0}},{"x":380,"y":212,"type":"queue","name":"queue_1","model":{"nservers":1,"mu":1,"infinite":true,"maxqlen":0}}]');
		
	});
		
	</script>
</head>

<body>
	<div id="toolbar_div">
		<span id="toolbar" class="ui-widget-header ui-corner-all">
			<span id="file_ops">
				<button id="new_file">New Canvas</button>
				<button id="load_file">Load a file</button>
				<button id="save_file">Save to file</button>
			</span>

			<span id="sim_play_ops">
				<div id="progressbar"></div>
				<button id="pause_sim">Pause</button>
				<button id="stop_sim">Stop</button>
			</span>
			<span id="sim_ops">
				<button id="play_sim">Simulate</button>
				<button id="config_sim">5000 sec</button>
			</span>
			
		</span>
	</div>


	<div id="canvas">	
	</div>
	
	<div id="results">
		<div id="server_stats" class="stats">
			<h2>Server 1</h2>
			<table class="stats_table" border="1">
				<tr><th>Metric</th> <th>Mean</th><th>Std Dev</th></tr>
				<tr><td>Arrivals</td><td id="arrival">-</td><td>-</td></tr>
				<tr><td>Server Utilization</td><td id="sutil">-</td><td>-</td></tr>
				<tr><td>Time spent in queue</td><td id="qtime">-</td><td id="qtimed">-</td></tr>
				<tr><td>Time spent in system</td><td id="stime">-</td><td id="stimed">-</td></tr>
				<tr><td>Size of queue</td><td id="qsize">-</td><td id="qsized">-</td></tr>
				<tr><td>Customers in system</td><td id="ssize">-</td><td id="ssized">-</td></tr>
			</table>
		</div>
		<div id="monitor_stats" class="stats">
			<h2>Monitor</h2>
			<table border="1" class="stats_table">
				<tr><th>Metric</th><th>Mean</th><th>Std Dev</th></tr>
				<tr><td>Arrivals</td><td id="arrival">-</td><td>-</td></tr>
				<tr><td>Inter-arrival (sec)</td><td id="inter">-</td><td id="interd">-</td></tr>
			</table>
		</div>
	</div>
	
	More here.
	<div id="server_form" title="Server Properties">
		<form>
		<fieldset>
			<label for="server_form_rate">Average Service Duration [1 / mu] (sec)</label>
			<input type="text" name="server_form_rate" id="server_form_rate" value="" class="text ui-widget-content ui-corner-all" />
		</fieldset>
		</form>
	</div>
	
	<div id="source_form" title="Source Properties">
		<form>
		<fieldset>
			<label for="source_form_rate">Average Arrival Rate [1 / lambda] (sec)</label>
			<input type="text" name="source_form_rate" id="source_form_rate" value="" class="text ui-widget-content ui-corner-all" />
		</fieldset>
		</form>
	</div>
	
	<div id="splitter_form" title="Splitter Properties">
		<form>
		<fieldset>
			<label for="source_form_rate">Average Arrival Rate [1 / lambda] (sec)</label>
			<input type="text" name="source_form_rate" id="source_form_rate" value="" class="text ui-widget-content ui-corner-all" />
		</fieldset>
		</form>
	</div>
	
	<div id="monitor_form" title="Splitter Properties">

	</div>
	
	<div id="save_dialog" title="Save">
		<p>Save the following to a text file. </p>
		<textarea id="save_textarea" name="save_textarea" rows="20" cols="80"></textarea>
	</div>
	<div id="load_dialog" title="Load">
		<p>Copy the text below</p>
		<textarea id="load_textarea" name="load_textarea" rows="20" cols="80"></textarea>
	</div>

	<div id="log">
		
	</div>

	
</body>

</html>